package com.molichuxing.job;

import com.molichuxing.service.CarViolationJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: renzhengyu
 * @Description: 大客户违章数据查询定时 每周四 10点执行
 * @Date: Created in 10:53 2019/12/10
 * @Modified By:
 **/
@JobHandler(value="carViolationKeyCustomersHandler")
@Component
public class CarViolationKeyCustomersHandler  extends IJobHandler {
    private static final Logger log = Logger.getLogger(CarViolationKeyCustomersHandler.class);

    @Resource
    private CarViolationJobService carViolationJobService;

    public CarViolationKeyCustomersHandler() {
        super();
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public void destroy() {
        super.destroy();
    }

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        ReturnT<String> returnT = ReturnT.SUCCESS;
        log.info("==============================大客户违章数据查询   开始定时任务");
        Boolean result = carViolationJobService.getCarViolationKeyCustomersHandler();
        log.info("==============================大客户违章数据查询  结束定时任务result：");
        returnT.setContent("大客户违章数据查询 定时任务的任务结果result："+ result);
        return returnT;
    }
}
